import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react-swc'

// https://vite.dev/config/
export default defineConfig({
  plugins: [react()],
  server: {
    proxy: {
      '/api': {
        target: 'http://127.0.0.1:5000',  // 代理目标地址
        changeOrigin: true,  // 支持跨域
        // rewrite: (path) => path.replace(/^\/api/, ''),  // 可选：重写路径
      },
    },
  },
})
